package com.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bean.Complex;
import com.bean.Unit;
import com.service.ComplexService;
import com.service.RoomService;
import com.service.UnitService;
@Controller
public class AddRoomAction {
	
	@Autowired
	private RoomService roomservice;
	
	
	@RequestMapping("addroom.do")
	public @ResponseBody void toAjax(Integer[]  ids){
		System.out.println("aaaaa");
		for (Integer rid : ids) {
			roomservice.updateByPrimaryKeyToCh(rid);
		}
	}
	
	@RequestMapping("deleroom.do")
	public @ResponseBody void toAjax1(Integer[]  ids){
		for (Integer rid : ids) {
			roomservice.updateByPrimaryKeyToDel(rid);
		}
	}
	
	@RequestMapping("addroomAll.do")
	public @ResponseBody void toAddAll(Integer pid){
		System.out.println("aaaaa"+pid);
		roomservice.updateByPidKeyToCh(pid);
	}
	@RequestMapping("deleroomAll.do")
	public @ResponseBody void deleroomAll(Integer pid){
		System.out.println(pid);
		roomservice.updateByPidToDel(pid);
	}
}
